using BCW;
using Holoville.HOTween;
using Holoville.HOTween.Core;
using I2.Loc;
using UnityEngine;

public class LeagueAvailableProduct : MonoBehaviour
{
	public UILabel productName;

	public UIBasicSprite productTexture;

	[HideInInspector]
	public Product currentProduct;

	public void SetInfo(Product product)
	{
		productTexture = productTexture.ReplaceForCurrentPlatform();
		currentProduct = product;
		productName.text = ScriptLocalization.Get("Market/" + product.id + "_title");
		CoroutineRunner.Instance.StartCoroutine(productTexture.LoadTextureAndAlphaMaskAsync("AtlasShopGuns/", product.texture));
		PopOn();
	}

	public void ShowProduct()
	{
		if (currentProduct != null)
		{
			MarketController.Instance.ShowMarket(currentProduct);
		}
	}

	private void PopOn()
	{
		HOTween.To(base.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one * 1.1f).OnComplete((TweenDelegate.TweenCallback)delegate
		{
			HOTween.To(base.transform, 0.15f, new TweenParms().Prop("localScale", Vector3.one));
		}));
	}
}
